package edu.hwadee.service.impl;

import edu.huadee.entity.Carsafety;
import edu.hwadee.dao.CarsafetyDAO;
import edu.hwadee.service.CarSafetyService;

public class CarSafetyServiceImpl implements CarSafetyService {
	private CarsafetyDAO carsafetydao;
	
	public CarsafetyDAO getCarsafetydao() {
		return carsafetydao;
	}

	public void setCarsafetydao(CarsafetyDAO carsafetydao) {
		this.carsafetydao = carsafetydao;
	}

	@Override
	public boolean exits(int carSafetyId) {

		Carsafety carsafety = carsafetydao.findById(carSafetyId);

		if(carsafety == null)
			return true;
		return false;
	}

	@Override
	public void save(Carsafety carsafety) {
		carsafetydao.save(carsafety);
	}

}
